import http from 'k6/http';
import { sleep } from 'k6';

export const options = {
  stages: [
    { duration: '5m', target: 50 }, // simulate ramp-up of traffic from 1 to 60 users over 5 minutes.
    { duration: '50m', target: 500 }, // stay at 60 users for 10 minutes
    { duration: '5m', target: 50 }, // ramp-up to 100 users over 3 minutes (peak hour starts)
    { duration: '50m', target: 500 }, // stay at 100 users for short amount of time (peak hour)
    { duration: '5m', target: 50 }, // ramp-down to 60 users over 3 minutes (peak hour ends)
  ],
  thresholds: {
    http_req_duration: ['p(99)<1500'], // 99% of requests must complete below 1.5s
  },
};

export default function () {
  http.get('https://10.244.8.151/');
  sleep(1);
}